package vn.nt.healthcare.server.ws.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import vn.nt.healthcare.server.ws.model.CompanyInfo;
import vn.nt.healthcare.server.ws.service.CompanyService;

@Controller
public class CompanyController {

	@Autowired
	private CompanyService companyService;

	@RequestMapping(value = "/listcompanies", method = RequestMethod.GET)
	public @ResponseBody
	List<CompanyInfo> getListCompanies(HttpServletRequest request,
			HttpServletResponse response) {
		System.out.println("getListCompanies");
		return companyService.findAll();
	}
}
